﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jim.K3Cloud;

/// <summary>
/// 分组保存
/// </summary>
[Sdk("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.GroupSave", "分组保存")]
public class K3CloudGroupSaveRequest : ISdkRequest<K3CloudGroupSaveResponse>,IK3CloudCustomRequest
{
    public string FormId { get; set; }
    /// <summary>
    /// 分组字段Key，字符串类型（必录） 注（不填时取默认，无默认，取第一个分组）
    /// </summary>
    public string GroupFieldKey { get; set; }
    /// <summary>
    /// 分组内码，修改分组数据时必录，整形
    /// </summary>
    public int GroupPkId { get; set; }
    /// <summary>
    /// 父分组内码，整型（非必录）
    /// </summary>
    public int FParentId { get; set; }
    /// <summary>
    /// 分组编码，字符串类型（必录） 注（必须唯一）
    /// </summary>
    public string FNumber { get; set; }
    /// <summary>
    /// 分组名，字符串类型（必录）
    /// </summary>
    public string FName { get; set; }
    /// <summary>
    /// 分组描述，字符串类型（非必录）
    /// </summary>
    public string FDescription { get; set; }

    public object QueryParams()
    {
        return new
        {
            FormId = FormId,
            Data = new {
                GroupFieldKey = GroupFieldKey,
                GroupPkId = GroupPkId,
                FParentId = FParentId,
                FNumber = FNumber,
                FName = FName,
                FDescription = FDescription
            }
        };
    }

    public void Validate()
    {
    }
}


public class K3CloudGroupSaveResponse : SdkResponse { }